xenpaging: handle evict failures
authorOlaf Hering <olaf@aepfle.de>
Thu, 13 Oct 2011 11:21:10 +0000 (12:21 +0100)
committerOlaf Hering <olaf@aepfle.de>
Thu, 13 Oct 2011 11:21:10 +0000 (12:21 +0100)
commit2d1f750000dc65ed6dd60a1ce8dd53c3bf3d59a5
tree307a2ce4031dabe6f9cc88a0fac5dea6215259bf
parente2d74530a9c6e9fabc2ad23dc522f6b40db503a3
xenpaging: handle evict failures

Evict of a nominated gfn must fail if some other process mapped the
page without checking the p2mt of that gfn first.
Add a check to cancel eviction if the page usage count is not 1.

Handle the possible eviction failure in the page-in paths.
After nominate and before evict, something may check the p2mt and call
populate. Handle this case and let the gfn enter the page-in path. The
gfn may still be connected to a mfn, so there is no need to allocate a
new page in prep.

Adjust do_mmu_update to return -ENOENT only if the gfn has entered the
page-in path and if it is not yet connected to a mfn. Otherwise
linux_privcmd_map_foreign_bulk() may loop forever.

Add MEM_EVENT_FLAG_EVICT_FAIL to inform pager that a page-in request for
a possible not-evicted page was sent. xenpaging does currently not need
that flag because failure to evict a gfn will be caught.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
tools/xenpaging/xenpaging.c
xen/arch/x86/mm.c
xen/arch/x86/mm/p2m.c
xen/include/public/mem_event.h